{extend name="public/common"} {block name="body"}

<div class="cl pd-5 bg-1 bk-gray mt-20"> 
  <span class="l" style="margin-left:15px;"><a style="" href="/admin/Operate/bonusChanceAdd?type={:input('get.type')}&lv={$lv}" class="btn btn-primary radius">新增红包概率 </a></span>
</div>

<div class="page-container" style="padding-top:0;">
  <div id="tab-system" class="HuiTab">
      <div class="mt-20">
        <table
          class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
          注：概率是指当前等级的红包所有的相加除以当前对应红包的数值。例：有3个1级红包概率分别是10%、20%、30%。那30%的红包获得的概率就是30/（10+20+30）=1/2的几率会出现，而10%的则是1/5的概率。
          <thead>
            <tr class="text-c">
              <th>ID</th>
              <th>红包等级</th>
              <th>中奖最小金额</th>
              <th>中奖最大金额</th>
              <th>概率</th>
              {if(input('get.type') == 'class')}
              <th>概率红包</th>
              {/if}
              <th>操作</th>
            </tr>
          
          </thead>
          <tbody>
            {volist name="list" id="DL"}
          
			<tr class="text-c">
			  <td>{$DL.id}</td>
			  <td>{if(input('get.type') == 'saving')}{$DL.lv}级红包{else/}{$class[$DL.lv]}{/if}</td>
			  <td>{$DL.min_money}</td>
			  <td>{$DL.max_money}</td>
			  <td>{$DL.chance}%</td>
			  {if(input('get.type') == 'class')}
			  <td>{$DL.chance_money}</td>
			  {/if}
			  <td>
			  {if(input('get.type') == 'saving')}
			  	<a href='/admin/Operate/bonuschanceEdit?id={$DL.id}' title="修改"><i class="Hui-iconfont">&#xe6df;</i></a>&nbsp;&nbsp;&nbsp;
			  	{/if}
			  	<a href='javascript:void(0);' onclick="delUserClass({$DL.id},{$DL.lv},'{:input('get.type')}')" title="删除"><i class="Hui-iconfont">&#xe609;</i></a>
			  </td>
			     
			</tr>
{/volist}
          </tbody>
        </table>
      </div>
  </div>
</div>

{/block}

{block name="js"} 
<script type="text/javascript">

function delUserClass(id,lv,type){
	//删除用户等级
	lv = String(lv);
	layer.confirm('确认删除该红包吗？', {
		  btn: ['确认','取消'] //按钮
		}, function(){
		  location.href='/admin/Operate/bonusChanceDel?type='+type+'&lv='+lv+'&id='+id;
		});
}

</script>
{/block}
 
